package oocl.ita.eordering.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import oocl.ita.eordering.dao.ClientDao;
import oocl.ita.eordering.po.Client;
import oocl.ita.eordering.service.ClientService;

@Service
public class ClientServiceImpl implements ClientService {
	@Autowired()
	private ClientDao clientDao;

	@Override
	@Transactional
	public Client clientLogin(String username, String password) {
		System.out.println(username);
		return clientDao.findClient(username, password);
	}

	@Override
	@Transactional
	public int clientRegist(Client client) {
		System.out.println(client.getcPassword());
		// TODO Auto-generated method stub
		return clientDao.addClient(client);
	}

	@Override
	@Transactional
	public int updateClientInfo(Client client) {
		// TODO Auto-generated method stub
		return clientDao.updateClient(client);
	}

}
